<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>

<script type="text/javascript">
    var rowId = 0;
    $('fbox_borrowerinfoGrid .ui-reset , #refresh_borrowerinfoGrid').click(function(){
        $("#borrowerinfoGrid").jqGrid('setGridParam',{search:false});
        var postData = $("#borrowerinfoGrid").jqGrid('getGridParam','postData');
        $.extend(postData,{searchField:"",searchString:"",searchOper:""});
        $.extend(postData,{filters:""});
        $("#borrowerinfoGrid").trigger("reloadGrid");
    });

    $.subscribe('searchBorrowersInfoGrid', function(event,data) {
        $("#borrowerinfoGrid").jqGrid('searchGrid', {closeAfterSearch:true,closeOnEscape:true,sopt:['eq'],caption:"Search Borrowers Info"} );
    });
    
    $.subscribe('showhideBorrowersInfoGrid', function(event,data) {
        $("#borrowerinfoGrid").jqGrid('setColumns',{});
    });
    
    $.subscribe('borrowerinfoGridComplete',function(event,data){
        $( "#borrowerinfoGrid_showhide" ).button( "option", "disabled", false );
        $( "#borrowerinfoGrid_search" ).button( "option", "disabled", false );
    });

</script>
<div class="gridOptsContainer">
    <sj:submit button="true" cssStyle="font-size:14px;" disabled="true" id="borrowerinfoGrid_search" onClickTopics="searchBorrowersInfoGrid" value="Search Borrower"/>
    <sj:submit button="true" cssStyle="font-size:14px;" disabled="true" id="borrowerinfoGrid_showhide" onClickTopics="showhideBorrowersInfoGrid" value="Show/Hide Columns"/>
</div>
<s:url id="remoteurl" action="grid-borrowerinfo"/>
<sjg:grid
    id="borrowerinfoGrid"
    caption="Cashmate Borrowers' Information"
    cellEdit="true"
    dataType="json"
    href="%{remoteurl}"
    gridModel="gridModel"
    pagerButtons="true"
    pagerInput="true"
    rowList="15,30,50"
    rowNum="15"
    loadingText="Requesting Data..."
    width="970"
    shrinkToFit="true"
    pager="true"
    hoverrows="true"
    rownumbers="true"
    autoencode="true"
    viewrecords="true"
    navigator="true"
    navigatorAdd="false"
    navigatorDelete="false"
    navigatorEdit="false"
    navigatorSearch="true"
    navigatorSearchOptions="{closeAfterSearch:true,closeOnEscape:true,sopt:['eq'],caption:'Search BorrowerInfo'}"
    navigatorView="true"
    onGridCompleteTopics="borrowerinfoGridComplete"
    onSelectRowTopics="borrowerinfoGridRowSelected"
    onCellEditSuccessTopics=""
    >

    <sjg:gridColumn name="infoid"
                    index="infoid"
                    title="Borrower Info ID"
                    sortable="false"
                    key="true"
                    hidden="true"
                    />

    <%--
    <sjg:gridColumn name="borrowercode"
                    index="borrowercode"
                    title="Borrower Code"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    />

    <sjg:gridColumn name="firstname"
                    index="firstname"
                    title="First Name"
                    search="true"
                    sortable="true"
                    searchoptions="{sopt:['eq']}"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:true}"
                    />

    <sjg:gridColumn name="middlename"
                    index="middlename"
                    title="Middle Name"
                    sortable="true"
                    align="center"
                    hidden="true"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:true}"
                    />

    <sjg:gridColumn name="lastname"
                    index="lastname"
                    title="Last Name"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:true}"
                    />  --%>

    <sjg:gridColumn name="degree"
                    index="degree"
                    title="Degree"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:false}"
                    />

    <sjg:gridColumn name="school"
                    index="school"
                    title="School"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:false}"
                    />

    <sjg:gridColumn name="yeargraduated"
                    index="yeargraduated"
                    title="Year Graduated"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:false}"
                    />
    
    <sjg:gridColumn name="fatherfirstname"
                    index="fatherfirstname"
                    title="Father firstname"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:true}"
                    />
    
    <sjg:gridColumn name="fathermiddlename"
                    index="fathermiddlename"
                    title="Father middlename"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:true}"
                    />
    
    <sjg:gridColumn name="fatherlastname"
                    index="fatherlastname"
                    title="Father lastname"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:true}"
                    />
    
    <sjg:gridColumn name="motherfirstname"
                    index="motherfirstname"
                    title="Mother firstname"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:true}"
                    />
    
    <sjg:gridColumn name="mothermiddlename"
                    index="mothermiddlename"
                    title="Mother middlename"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:true}"
                    />
    
    <sjg:gridColumn name="motherlastname"
                    index="motherlastname"
                    title="Mother lastname"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:true}"
                    />
    
    <sjg:gridColumn name="fatherage"
                    index="fatherage"
                    title="Father's age"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'11'}"
                    editrules="{required:true}"
                    />
    
    <sjg:gridColumn name="motherage"
                    index="motherage"
                    title="Mother's age"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'11'}"
                    editrules="{required:true}"
                    />
    
    <sjg:gridColumn name="fatheremployer"
                    index="fatheremployer"
                    title="Father employer"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:false}"
                    />
    
    <sjg:gridColumn name="motheremployer"
                    index="motheremployer"
                    title="Mother employer"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:false}"
                    />
    
    <sjg:gridColumn name="fatherposition"
                    index="fatherposition"
                    title="Father position"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:false}"
                    />
    
    <sjg:gridColumn name="motherposition"
                    index="motherposition"
                    title="Mother position"
                    search="true"
                    searchoptions="{sopt:['eq']}"
                    sortable="true"
                    align="center"
                    editable="true"
                    edittype="text"
                    editoptions="{maxlength:'45'}"
                    editrules="{required:false}"
                    />
    
</sjg:grid>